/**
 * Created by Administrator on 2019/6/10.
 */

var dt_nav_btn = document.querySelector("#dt_nav_btn");

var dt_nav_content = document.querySelector("#dt_nav_content");

dt_nav_btn.addEventListener("mouseover",function () {
    dt_nav_content.style.display = "block";
})
dt_nav_content.addEventListener("mouseleave",function () {
    dt_nav_content.style.display = "none";
})



var t = document.querySelector("#toTop");
window.onscroll = function () {
    console.log(document.body.scrollTop > 1000 || document.documentElement.scrollTop );

    if (document.body.scrollTop >1000 || document.documentElement.scrollTop){
        t.style.display = "block";
    }else {
        t.style.display = "none";
    }
}

//点击回到顶部
t.addEventListener('click',function () {
    window.scrollTo({
        top: 0,
        behavior: 'smooth'
    })
})




var swiper = new Swiper('.swiper-container', {
    slidesPerView: 1,
    spaceBetween: 30,
    loop: true,
    pagination: {
        el: '.swiper-pagination',
        clickable: true,
    },
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
    },
});